package Entidades;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name="Producto")
@Inheritance(strategy=InheritanceType.JOINED)
public abstract class Producto {
	private static final long serialVersionUID = 1L;
	
	@Id @GeneratedValue(strategy=GenerationType.AUTO)
	@Column(nullable=false, name="idProd")
	private int idProd;
	
	@Column(nullable=false, length=25, name="codigo")
	private String codigo;
	
	@Column(nullable=false, length=60, name="descripcion")
	private String descripcion;
	
	@Column(nullable=false, name="precio")
	private float precio;
	
	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(nullable=false,name="idUni")
	private Unidad uConsumo;
	
	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(nullable=false,name="idUni")
	private Unidad uCompra;
	
	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(nullable=false,name="idStock")
	private Stock stock;

}
